<div class="x-list-title">
	<table width="100%" border="0" height="100%">
	<tr>
		<td align="left">
			<h2>
				Sửa liên hệ
			</h2>
		</td>
		<td align="right">	
			<div class="x-list-options">

			</div>
		</td>
	</tr>
	</table>	
</div>
<?php $post = $this->get('post');?>
<form method="post" action="<?php _actionUrl($this);?>" onsubmit="return ajax_form(this)">
<?php if( get('redirect') ): ?>
<input type="hidden" name="redirect" value="<?php _e(get('redirect'));?>"/>
<?php endif;?>
<input type="hidden" name="ID" value="<?php _e(get('ID'))?>"/>
<div class="x-form-container">
	<div class="form-message"></div>
	<table width="100%" cellpadding="4" class="x-form">
		<tr>
			<td class="x-form-label" style="width:133px">Mã: </td>
			<td class="x-form-input">
				<?php _e(tpl_input_code('code',$post['code'])) ?>
			</td>
		</tr>
		
			<tr>
				<td class="x-form-label">Tên liên hệ: </td>
				<td class="x-form-input">
					<input class="x-text" type="text" name="title" value="<?php _e($post['title'])?>" style="width:400px"/>
				</td>
			</tr>
			
			<tr>
				<td class="x-form-label">Công ty: </td>
				<td class="x-form-input">
					<?php 
						_e(tpl_auto_select(array(
							name	=>	'customer_id',
							type 	=>  'autosingle',
							url 	=>	baseUrl().'/Crm/Helper/Customer',
							title	=>	'name',
							link 	=> 	'#Crm/Customer/View?ID=',
							items	=>	 array($this->get('customer'))
						)));
					?>	
				</td>
			</tr>

			<tr>
				<td class="x-form-label">Người đầu mối: </td>
				<td class="x-form-input">
					<input class="x-text" type="text" name="person_contact" style="width:400px;" value="<?php _e($post['person_contact'])?>"/>
				</td>
			</tr>
			
			<tr>
				<td class="x-form-label">Chức vụ: </td>
				<td class="x-form-input">
					<input class="x-text" type="text" name="jobtitle" style="width:400px;" value="<?php _e($post['jobtitle'])?>"/>
				</td>
			</tr>
			
			<tr>
				<td class="x-form-label">Địa chỉ:</td>
				<td class="x-form-input">
					<input class="x-text" type="text" name="address" style="width:400px;" value="<?php _e($post['address'])?>"/>
				</td>
			</tr>			
			
			<tr>
				<td class="x-form-label">Di động: </td>
				<td class="x-form-input">
					<input class="x-text" type="text" name="mobile" style="width:150px;" value="<?php _e($post['mobile'])?>"/>
				</td>
			</tr>

			<tr>
				<td class="x-form-label">Cố định: </td>
				<td class="x-form-input">
					<input class="x-text" type="text" name="phone" style="width:150px;" value="<?php _e($post['phone'])?>"/>
				</td>
			</tr>
			
			<tr>
				<td class="x-form-label">Email: </td>
				<td class="x-form-input">
					<input class="x-text" type="text" name="email" style="width:400px;"  value="<?php _e($post['email'])?>"/>
				</td>
			</tr>			
			
			<tr>
				<td class="x-form-label">Website: </td>
				<td class="x-form-input">
					<input class="x-text" type="text" name="website" style="width:400px;" value="<?php _e($post['website'])?>"/>
				</td>
			</tr>			
			
			<tr>
				<td class="x-form-label">Sinh nhật: </td>
				<td class="x-form-input">
					<input type="text" name="birthday" value="<?php _e(show_date(DATE_FORMAT,$post['birthday']))?>" onclick="date_picker(this,{format: 'd/m/Y' })" class="x-text x-date"/>
				</td>
			</tr>			
			
			<tr>
				<td class="x-form-label">Chăm sóc: </td>
				<td class="x-form-input">
					<?php _e(tpl_select_user('care_by_id','',$this->get('care')));?>
				</td>
			</tr>

			<tr>
				<td class="x-form-label">Mô tả: </td>
				<td class="x-form-input">
					<textarea class="x-text" name="desc" style="width:500px;height:100px"><?php _e($post['desc'])?></textarea>
				</td>
			</tr>

			<tr>
				<td class="x-form-label" align="center" valign="top">
					<span class="x-attachment"></span>
				</td>
				<td class="x-form-input" valign="top">
					<?php foreach( $this->get('files') as $file ):?>
					<div class='x-file-info'>
						<input checked type='checkbox' name='files[]' value='<?php _e($file['ID']);?>'/>
						<a href="<?php _ctrUrl($this);?>/File?ID=<?php _e($file['ID']);?>" target="_blank"><?php _e($file['filename']);?> <?php _e($file['size']);?> KB	</a>
					</div>
					<?php endforeach;?>				
					<div class="x-files" url="<?php _baseUrl();?>/Crm/Contact/Upload?post_id=<?php $this->e('ID')?>"></div>
				</td>
			</tr>			
			
			<tr>
				<td></td>
				<td class="x-form-input">
					<input type="submit" value="Xác Nhận" class="x-button x-save"/>
					<a href="#Crm/Customer" class="x-button x-fresh">Hủy bỏ</a>
				</td>
			</tr>
	</table>
</div>
</form>
